<load target="js/theme.js" type="body" usecdn="true" />

<script type="text/javascript">
jQuery(function($){

var themes = {};

<!--@foreach($theme_list as $key=>$val)-->
{@$skins = array()}
<!--@foreach($val->skin_infos as $module=>$skin_info)-->
	{@$skins[] = "'".$module."' : '".$skin_info->name."'";}
<!--@end-->
themes['{$key}'] = {
	'layout': '{$val->layout_info->layout_srl}',
	{implode(',',$skins)}
};

<!--@end-->
$('#theme').data('themes', themes);

});
</script>

<h1 class="h1">{$lang->menu_gnb_sub['theme']}</h1>
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<form ruleset="insertThemeInfo" action="./" method="post" class="form">
	<input type="hidden" name="module" value="admin" />
	<input type="hidden" name="act" value="procAdminInsertThemeInfo">
	<fieldset id="theme">
		<h2 class="h2">{$lang->theme_setting}</h2>
		<p>{$lang->theme_desc}</p>
		<ul class="thumbPreview">
			<li>
				<p class="q">{$lang->selected_theme}</p>
				<ul class="a">
					{@$current_theme = ($theme_info)?$theme_info->theme:'user_define'}
					<li class="i" loop="$theme_list=>$key,$val">
						<span class="thumb"><!--@if($val->thumbnail)--><img src="{$val->thumbnail}" alt="" /><!--@else-->{$lang->msg_thumbnail_not_exist}<!--@end--></span>
						<input type="radio" name="themeItem" id="{$key}" value="{$key}" <!--@if($key == $current_theme)-->checked="checked"<!--@end--> />
						<label for="{$key}">{$val->title}({$key})</label>
						<ul>
							<li>&middot; {$lang->version}: {$val->version}</li>
							<li>&middot; {$lang->author}:
								<!--@foreach($val->publisher as $publisher)-->
								<a href="{$publisher->homepage}" cond="$publisher->homepage">{$publisher->name}</a>
								<!--@if(!$publisher->homepage)-->{$publisher->name}<!--@end-->
								<!--@endforeach-->
							</li>
							<li>&middot; {$lang->description}: {$val->description}</li>
							<li>&middot; {$lang->path}: {$val->path}</li>
						</ul>
					</li>
					<li class="i userDefine">
						<span class="thumb">{$lang->by_you}</span>
						<input type="radio" name="themeItem" id="theme_user_define" value="user_define" <!--@if($current_theme == 'user_define')-->checked="checked"<!--@end--> />
						<label for="theme_user_define">{$lang->user_define}</label>
						<ul>
							<li>&middot; {$lang->description}: {$lang->no_selected_theme_desc}</li>
						</ul>
					</li>
				</ul>
			</li>
		</ul>
	</fieldset>
	<fieldset id="skin">
		<p>{$lang->user_define_skin_select_desc} <button type="button" class="showAll"></button></p>
		<ul class="thumbPreview jx">
			<li data-skintype="layout">
				<p class="q">{$lang->selected_layout}</p>
				<ul class="a">
					<li class="i" loop="$layout_list=>$val">
						<span class="thumb"><span class="frame"><!--@if($val->thumbnail)--><img src="{$val->thumbnail}" alt="" /><!--@else-->{$lang->msg_thumbnail_not_exist}<!--@end--></span></span>
						<input type="radio" name="layout" id="layout_{$val->layout_srl}" value="{$val->layout_srl}" <!--@if($val->layout_srl == $current_layout)-->checked="checked"<!--@end--> />
						<label for="layout_{$val->layout_srl}">{$val->layout_title.'('.$val->layout.')'}</label>
						<ul>
							<li>&middot; {$lang->version}: {$val->version}</li>
							<li>&middot; {$lang->author}:
								<!--@foreach($val->author as $author)-->
								<a href="{$author->homepage}" cond="$author->homepage">{$author->name}</a>
								<!--@if(!$author->homepage)-->{$author->name}<!--@end-->
								<!--@endforeach-->
							</li>
							<li>&middot; {$lang->description}: {$val->description}</li>
							<li>&middot; {$lang->path}: {$val->path}</li>
							<li>&middot; {$lang->cmd_setup}: <a href="{getUrl('', 'module', 'admin', 'act', 'dispLayoutAdminModify', 'layout', $val->layout,'layout_srl', $val->layout_srl)}">{$lang->cmd_edit}</a></li>
						</ul>
					</li>
				</ul>
			</li>
			<li loop="$module_list=>$mkey,$mval" cond="$mkey!='__IS_PARSE__'" data-skintype="{$mkey}">
				<p class="q">{sprintf($lang->selected_skin, $mval['title'])}</p>
				<ul class="a">
					<li class="i noDirection" cond="!$theme_info->skin_info[$mkey]">
						<span class="thumb"><span class="frame"></span></span>
						<strong>{sprintf($lang->no_selected_skin, $mval['title'])}</strong>
						<ul>
							<li>{$lang->no_selected_skin_desc}</li>
						</ul>
					</li>
					<li class="i" loop="$mval['skins']=>$skey,$sval">
						{@ $id = $mkey.'_'.$skey }
						<span class="thumb"><span class="frame"><!--@if($sval->thumbnail)--><img src="{$sval->thumbnail}" alt="" /><!--@else-->{$lang->msg_thumbnail_not_exist}<!--@end--></span></span>
						<input type="radio" name="{$mkey}-skin" id="{$id}" value="{$skey}" checked="checked"|cond="$theme_info->skin_info[$mkey]==$skey" />
						<label for="{$id}">{$sval->title.'('.$skey.')'}</label>
						<ul>
							<li>&middot; {$lang->version}: {$sval->version}</li>
							<li>&middot; {$lang->author}:
								<!--@foreach($sval->author as $author)-->
								<a href="{$author->homepage}" cond="$author->homepage">{$author->name}</a>
								<!--@if(!$author->homepage)-->{$author->name}<!--@end-->
								<!--@endforeach-->
							</li>
							<li>&middot; {$lang->description}: {$sval->description}</li>
						</ul>
					</li>
					<li class="i">
						<span class="thumb"><span class="frame">{$lang->msg_thumbnail_not_exist}</span></span>
						<input type="radio" name="{$mkey}-skin" id="{$mkey}_none" value="" checked="checked"|cond="!$theme_info->skin_info[$mkey]" />
						<label for="{$mkey}_none">{$lang->no_select}</label>
					</li>
				</ul>
			</li>
		</ul>
	</fieldset>
	<div class="btnArea">
		<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
	</div>
</form>
